#ifndef __log_cpp
#define __log_cpp

#include <iostream>
#include <string>
#include <windows.h>
#include "CriticalSectionWrapper.h"

enum Level
{
  ERR,
  WARN,
  DEBUG,
  INFO
};

class MyLog
{
  public:
    static void Log(Level level, std::string message)
    {
      critical_section.Acquire();
      switch(level){
        case Level::ERR:
          std::cout << "ERROR" << " + " << "PRINT SOME TEXT!\n";
          break;
        case Level::DEBUG:
          std::cout << "DEBUG" << " + " << "PRINT SOME TEXT!\n";
          break;
        case Level::WARN:
          std::cout << "WARNING" << " + " << "PRINT SOME TEXT!\n";
          break;
        case Level::INFO:
          std::cout << "INFO" << " + " << "PRINT SOME TEXT!\n";
          break;
        default:
          std::cout << "UNKNOWN " << " + " << "PRINT SOME TEXT!\n";
          break;
      }
      critical_section.Release();
    }

    static void init(int rotationNumberFiles, int maxFileSize)
    {
      setRotationNumberFiles(rotationNumberFiles);
      setMaxFileSize(maxFileSize);
    }

    static void setRotationNumberFiles(int rotationNumberFiles)
    {
      MyLog::rotationNumberFiles = rotationNumberFiles;
    }
    static int getRotationNumberFiles()
    {
      return MyLog::rotationNumberFiles;
    }

    static void setMaxFileSize(int maxFileSize)
    {
      MyLog::maxFileSize = maxFileSize;
    }
    static int getMaxFileSize()
    {
      return MyLog::maxFileSize;
    }

private:
  static int rotationNumberFiles;
  static int maxFileSize;
  static int currentFileNumber;
  static CritSectionWrapper critical_section;

};



#endif //__log_cpp

